/**
 * The scores package of the application.
 */
package fr.umlv.m2.android.quizz.scores;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import fr.umlv.m2.android.quizz.R;

/**
 * This class defines scores activity of the application.
 * 
 * @author Gambouele Bertrand.
 * @author Viravout Alexandre.
 */
public class ScoresActivity extends TabActivity {	
	/**
	 * The item title key.
	 */
	public static final String ITEM_TITLE = "title";
	/**
	 * The item subtitle key.
	 */
	public static final String ITEM_SUBTITLE = "subtitle";
	/**
	 * The item image key.
	 */
	public static final String ITEM_IMAGE = "image";

	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    this.setContentView(R.layout.tab_with_icon);
	    
	    final Resources resources = this.getResources();
	    final TabHost tabHost = this.getTabHost();
	    
	    final TabSpec singlePlayerTab = tabHost.newTabSpec(
	    		resources.getString(R.string.scoresSinglePlayerTabText)		
	    );
	    singlePlayerTab.setIndicator(
	    		"Seul joueur",
	    		resources.getDrawable(R.drawable.scores_single_player_tab)
	    );
	    Intent intent = new Intent(this, ScoresSinglePlayerTabActivity.class);
	    singlePlayerTab.setContent(intent);
	    
	    final TabSpec multiplayerTab = tabHost.newTabSpec(
	    		resources.getString(R.string.scoresMultiplayerTabText)
	    );
	    multiplayerTab.setIndicator(
	    		"Multijoueur",
	    		resources.getDrawable(R.drawable.scores_multiplayer_tab)
	    );
	    intent = new Intent(this, ScoresMultiplayerTabActivity.class);
	    multiplayerTab.setContent(intent);
	    
	    tabHost.addTab(singlePlayerTab);
	    tabHost.addTab(multiplayerTab);
	}
}
